var fs = require("fs");
var path = require("path");

var filePath = path.join(__dirname, "/2.txt");
var writeable = fs.createWriteStream(filePath);

writeable.write("hello world"); //将文本写入2.txt
writeable.end(); // 执行完目录中多出2.txt